﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using TiposComuns.Objectos;
using Servidor.Objectos.Pesquisa;

namespace Servidor.Objectos.Actions
{
    [Serializable]
    public class StoreListSearchedAction : Action
    {
        private SearchResult res;
        private byte[] key;

        public StoreListSearchedAction() { }

        public StoreListSearchedAction(IDMsg id, byte[] key, SearchResult res) : base(id)
        {
            this.res = res;
            this.key = key;
        }

        public byte[] Key
        {
            get { return key; }
            set { key = value; }
        }

        public SearchResult Res
        {
            get { return res; }
            set { res = value; }
        }

        public override void Execute(User user)
        {
            user.Searched.Merge(key,res);
        }

        public override void RollBack(User user)
        {
            
        }
    }
}
